﻿using System;
using System.Linq;

namespace Fuse8.DomainFramework.Domain
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TEntity"></typeparam>
    public interface IEntityCommand<out TEntity> where TEntity : class, IEntityObject
    {
        /// <summary>
        /// 
        /// </summary>
        string CommandName { get; }

        /// <summary>
        /// Used for cache
        /// </summary>
        string CacheKey { get; }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IQueryable<TEntity> Execute();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        TEntity ExecuteOne();
    }
}
